<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./bootstrap.min.css">
</head>
<body>
  <script src="./vue.js"></script>
  <div id="app">
    <table class="table table-bordered table-hover table-striped">
      <thead>
        <th>索引</th>
        <th>Id</th>
        <th>姓名</th>
        <th>状态</th>
      </thead>
      <tbody>
        <!-- 官方建议，只要使用了v-for指令，那么一定要绑定一个:key属性 -->
        <!-- 而且，尽量把id作为key的值 -->
        <tr v-for="(item,index) in list" :key="item.id"   :title="item.name">
          <td>{{index}}</td>
          <td>{{item.id}}</td>
          <td>{{item.name}}</td>
          <td>
            <input type="checkbox" v-model="item.status" :id="'cd' + item.id">
            <label v-if="item.status" :for="'cd' + item.id">已启用</label>
            <label v-else :for="'cd' + item.id">已禁用</label>
            <input type="text" v-model="item.status">
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <script>
  const vm = new Vue({
    el:'#app',
    data:{
      tips:'123',
      list:[
        {id:1,name:'张三',status:true},
        {id:2,name:'李四',status:true},
        {id:3,name:'王五',status:false},
        {id:4,name:'老六',status:false}
      ]
    },
    methods:{

    }
  })
  </script>
</body>
</html>